/**
 * There are <a href="https://github.com/thinkgem/jeesite">JeeSite</a> code generation
 */
package com.chlitina.store.modules.sms.service;

import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Order;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.chlitina.store.common.persistence.Page;
import com.chlitina.store.common.service.BaseService;
import com.chlitina.store.modules.sms.dao.SmsStoreGroupLogDetailDao;
import com.chlitina.store.modules.sms.entity.SmsStoreGroupLogDetail;

/**
 * 店面群发短信详情Service
 * @author lvbo
 * @version 2013-07-11
 */
@Component
@Transactional(readOnly = true)
public class SmsStoreGroupLogDetailService extends BaseService {

	@SuppressWarnings("unused")
	private static Logger logger = LoggerFactory.getLogger(SmsStoreGroupLogDetailService.class);
	
	@Autowired
	private SmsStoreGroupLogDetailDao smsStoreGroupLogDetailDao;
	
	public SmsStoreGroupLogDetail get(Long id) {
		return smsStoreGroupLogDetailDao.findOne(id);
	}
	
	public Page<SmsStoreGroupLogDetail> find(Page<SmsStoreGroupLogDetail> page, SmsStoreGroupLogDetail smsStoreGroupLogDetail) {
		DetachedCriteria dc = smsStoreGroupLogDetailDao.createDetachedCriteria();
		dc.addOrder(Order.desc("id"));
		return smsStoreGroupLogDetailDao.find(page, dc);
	}
	
	@Transactional(readOnly = false)
	public void save(SmsStoreGroupLogDetail smsStoreGroupLogDetail) {
		smsStoreGroupLogDetailDao.save(smsStoreGroupLogDetail);
	}
	
}
